package com.fourth.controller;

import com.fourth.dto.Result;
import com.fourth.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 这是测试全局异常处理的接口 不用理睬后续删掉
 *
 *  * @author 邓建波
 */
@Api("测试")
@RestController
public class ErrorController {
    @Resource
    private SmsService smsService;

    @ApiOperation(value = "异常测试")
    @GetMapping("/ae")
    public void ae(){
        int a  =  1 / 0;
    }

    @GetMapping("/sendCode")
    public Result testSMS(){
        Result result = Result.ok();
        try {
             result = smsService.sendSms("15985218025", "996007");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}
